<template>
  <div class="reportFormPage">
    <div class="report-dom">
      <el-row>
        <el-col :span="5" :offset="19">
          <div class="pageNumBox">
            <span>第</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.page }}&nbsp;</span>
            <span>页，共</span>
            <span class="placeholder-min text-center">&nbsp;{{ form.totalPage }}&nbsp;</span>
            <span>页</span>
          </div>
        </el-col>
      </el-row>
      <div class="topTwoBox">
        <div class="centerName">{{ this.form.baobmc }}</div>
        <div class="codeText">
          <tr v-for="(item, index) in form.baobbhList">{{ item }}</tr>
        </div>
      </div>
      <div class="threeTopBox">
        <div class="left-border">
          <div class="box-title">检测单位名称：</div>
          <div class>{{ form.jiancdwmc }}</div>
        </div>
        <div class="right-border">
          <span>记录编号：</span>
          <span class="placeholder">{{ form.jilbh }}</span>
        </div>
      </div>
      <!-- .........................1111111111111111111111111111111......................................................... -->
      <div class="table-border">
        <table height="200px" class="top-table">
          <tbody>
            <tr>
              <td height="30" align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程名称</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcmc }}</span>
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">工程部位/用途</span>
              </td>
              <td width="35%" class="text-center">
                <span>{{ form.gongcbwyt }}</span>
              </td>
            </tr>
            <tr>
              <td height="40" align="center">样品信息</td>
              <td class="specimen-border" colspan="3">
                <span>样品名称：</span>
                <span :class="{ 'placeholder': !form.yangpmc }">{{ form.yangpmc }}</span>
                <span>；样品编号：</span>
                <span :class="{ 'placeholder-long': !form.yangpbh }">{{ form.yangpbh }}</span>

                <span>；样品数量：</span>
                <span :class="{ 'placeholder': !form.yangpsl }">{{ form.yangpsl }}</span>
                <span>；样品状态：</span>
                <span :class="{ 'placeholder': !form.yangpzt }">{{ form.yangpzt }}</span>
                <span>；来样时间：</span>
                <span :class="{ 'placeholder': !form.yangpsj }">{{ form.yangpsj }}</span>
              </td>
            </tr>

            <tr>
              <td height="25" align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验检测日期</span>
              </td>
               <!-- <td width="35%" class="text-center">{{ form.shiyjcrq }}</td> -->                                            
 <td width="35%" class="text-center">
      <el-input v-model="form.shiyjcrq" />
</td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">试验条件</span>
              </td>
              <td v-if="isPdf" width="35%">
                温度：
                <span style="display: inline-block; width: 10%;">{{ form.shiytjwd }}</span>
                ℃；湿度：
                <span style="display: inline-block; width: 10%;">{{ form.shiytjsd }}</span>%RH
              </td>
              <td v-else width="35%">
                温度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjwd" style="width: 15%" />℃；湿度：
                <el-input :type="isPdf ? 'string' : 'number'" v-model="form.shiytjsd" style="width: 15%" />%RH
              </td>
            </tr>

            <tr>
              <td height="40" align="center" width="15%">
                <span style="width: 90px; display: inline-block">检测依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.jiancyj }}</span>
                <el-input v-else type="textarea" v-model="form.jiancyj" :rows="2" class="mark"
                  @dblclick.native="showBsJiancyjView" readonly />
              </td>
              <td align="center" width="15%">
                <span style="width: 90px; display: inline-block">判定依据</span>
              </td>
              <td width="35%">
                <span v-if="isPdf">{{ form.pandyj }}</span>
                <el-input v-else type="textarea" v-model="form.pandyj" :rows="2" @dblclick.native="showBsJudgeBaseView"
                  @focus="handleFocus('pandyj')" class="mark" />
              </td>
            </tr>
            <tr class="bottom-border">
              <td height="40" align="center">
                <div>主要仪器设备</div>
                <div>名称及编号</div>
              </td>
              <td colspan="3">
                <span v-if="isPdf">{{ form.zhuyyqsbmcjbh }}</span>
                <el-input v-else type="textarea" :rows="2" v-model="form.zhuyyqsbmcjbh" class="height100 width100 mark"
                  @dblclick.native="showBsInstrumentView" readonly></el-input>
              </td>
            </tr>
          </tbody>
        </table>
        <table height="40px" class="middle-table">
          <tr>
            <td height="30" align="center" width="15%">
              <span style="width: 90px; display: inline-block">取样地点</span>
            </td>
            <td width="35%">
              <el-input v-model="form.quydd" @blur="backBgBaseData()" @keydown.native="handleKeyDown($event, 0, 0)" :ref="'0_0'"></el-input>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">代表数量</span>
            </td>
            <td width="35%">
              <el-input v-model="form.daibsl" @blur="backBgBaseData()" @keydown.native="handleKeyDown($event, 0, 1)" :ref="'0_1'"></el-input>
            </td>
          </tr>
          <tr>
            <td height="30" align="center" width="15%">
              <span style="width: 90px; display: inline-block">进场日期</span>
            </td>
            <td width="35%">
              <el-input v-model="form.jincrq" @blur="backBgBaseData()" @keydown.native="handleKeyDown($event, 1, 0)" :ref="'1_0'"></el-input>
            </td>
            <td align="center" width="15%">
              <span style="width: 90px; display: inline-block">产地</span>
            </td>
            <td width="35%">
              <el-input v-model="form.cd" @blur="backBgBaseData()" @keydown.native="handleKeyDown($event, 1, 1)" :ref="'1_1'"></el-input>
            </td>
          </tr>
        </table>
        <table height="30px" class="middle-table">
          <tr>
            <td width="15%">
              <span>集料用途</span>
            </td>
            <td width="20%">
              <span v-if="isPdf">{{ form.jilyt }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.jilyt" @blur="backBgBaseData()" @keydown.native="handleKeyDown($event, 2, 0)" :ref="'2_0'"></el-input>
            </td>
            <td width="10%">
              <span>混合料名称</span>
            </td>
            <td width="20%">
              <span v-if="isPdf">{{ form.hunhlmc }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.hunhlmc" @blur="backBgBaseData()" @keydown.native="handleKeyDown($event, 2, 1)" :ref="'2_1'"></el-input>
            </td>
            <td width="15%">
              <span>规定级配名称</span>
            </td>
            <td width="20%">
              <span v-if="isPdf">{{ form.guidjpmc }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.guidjpmc" @blur="backBgBaseData()" @keydown.native="handleKeyDown($event, 2, 2)" :ref="'2_2'"></el-input>
            </td>
          </tr>
        </table>
        <!-- .................................22222222222222222222222222222222............................................... -->
        <table height="560px" class="middle-table">
          <tr trindex="0">
            <td colspan="2" rowspan="2" class="td-left">
              <div>干燥试样总质量m<sub>1</sub>(g)</div>
            </td>
            <td colspan="4" class="td4" height="20">
              <div>第1组</div>
            </td>
            <td colspan="4" class="td4">
              <div>第2组</div>
            </td>
            <td rowspan="4" colspan="1" class="td1">
              <div>平均值</div>
            </td>
            <td rowspan="5" colspan="2" class="td2">
              <div>规定级配范围(%)</div>
            </td>
          </tr>
          <tr trindex="2">
            <td colspan="4" class="td4">
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ganzsyzl1"
                @blur="ganzsyzlChange(1)"  @keydown.native="handleKeyDown($event, 3, 0)" :ref="'3_0'"/>
            </td>
            <td colspan="4" class="td4">
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.ganzsyzl2"
                @blur="ganzsyzlChange(2)" @keydown.native="handleKeyDown($event, 3, 1)" :ref="'3_1'"/>
            </td>
          </tr>
          <tr trindex="3">
            <td colspan="2" height="28px" class="td-left">
              <div>水洗后筛上总量m<sub>2</sub>(g)</div>
            </td>
            <td colspan="4" width="30%">
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.shuixhsszl1"
                @blur="shuixhsszlChange(1)" @keydown.native="handleKeyDown($event, 4, 0)" :ref="'4_0'"/>
            </td>
            <td colspan="4" width="30%">
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="form.shuixhsszl2"
                @blur="shuixhsszlChange(2)" @keydown.native="handleKeyDown($event, 4, 1)" :ref="'4_1'"/>
            </td>
          </tr>
          <tr trindex="3">
            <td colspan="2" width="10%" height="28px">
              <div>水洗0.075mm筛下量m0.075 (g)</div>
            </td>
            <td colspan="4">{{ form.shaixl1 }}</td>
            <td colspan="4">{{ form.shaixl2 }}</td>
          </tr>
          <tr trindex="3">
            <td colspan="2" width="10%" height="28px">
              <div>0.075mm通过率P0.075 (%)</div>
            </td>
            <td colspan="4">{{ form.tonggl1 }}</td>
            <td colspan="4">{{ form.tonggl2 }}</td>
            <td colspan="1">{{ form.pingj }}</td>
          </tr>
          <tr trindex="4">
            <td colspan="2" class="td-left">
              <div>筛孔尺寸(mm)</div>
            </td>
            <td class="td1">
              <div>筛上质量mi(g)</div>
            </td>
            <td class="td1">
              <div>分计筛余(%)</div>
            </td>
            <td class="td1">
              <div>累计筛余(%)</div>
            </td>
            <td class="td1">
              <div>通过百分率(%)</div>
            </td>
            <td class="td1">
              <div>筛上质量mi(g)</div>
            </td>
            <td class="td1">
              <div>分计筛余(%)</div>
            </td>
            <td class="td1">
              <div>累计筛余(%)</div>
            </td>
            <td class="td1">
              <div>通过百分率(%)</div>
            </td>
            <td class="td1">
              <div>通过百分率(%)</div>
            </td>
            <td class="td1">
              <div>最大值</div>
            </td>
            <td class="td1">
              <div>最小值</div>
            </td>
          </tr>
          <tr v-for="(item, index) in form.baDetailVos" :key="index">
            <td rowspan="14" v-if="index === 0" width="5%">
              <div>水</br>洗</br>后</br>干</br>筛</br>法</br>筛</br>分</div>
            </td>
            <td width="10%">
              <!-- {{  `${index +5}_0`}} -->
              <el-input type="text" tabindex="200" v-model="item.shaikcc" @blur="shaikccChange()" @keydown.native="handleKeyDown($event, index+5, 0)" :ref="`${index+5}_0`"/>
            </td>
            <td>
              <!-- {{ `${index+5}_1` }} -->
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="item.shaisz1"
                @blur="detailChange(1, index)" @keydown.native="handleKeyDown($event, index+5, 1)" :ref="`${index+5}_1`"/>
            </td>
            <td>
              <div>{{ item.fenjsy1 }}</div>
            </td>
            <td>
              <div>{{ item.leijsy1 }}</div>
            </td>
            <td>
              <div>{{ item.tonggbfl1 }}</div>
            </td>
            <td>
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="item.shaisz2"
                @blur="detailChange(2, index)"  @keydown.native="handleKeyDown($event, index+5, 2)" :ref="`${index+5}_2`"/>
            </td>
            <td>
              <div>{{ item.fenjsy2 }}</div>
            </td>
            <td>
              <div>{{ item.leijsy2 }}</div>
            </td>
            <td>
              <div>{{ item.tonggbfl2 }}</div>
            </td>
            <td>
              <div>{{ item.tonggbflPjz }}</div>
            </td>
            <td>
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="item.zuidz"  @keydown.native="handleKeyDown($event, index+5, 3)" :ref="`${index+5}_3`"/>
            </td>
            <td>
              <el-input :type="isPdf ? 'string' : 'number'" tabindex="200" v-model="item.zuixz"  @keydown.native="handleKeyDown($event, index+5, 4)" :ref="`${index+5}_4`"/>
            </td>
          </tr>
          <tr>
            <td colspan="2" class="td-left" height="25">
              <div>筛分后总量(g)</div>
            </td>
            <td colspan="4" class="td4">
              <div>{{ this.form.ganshzl1 }}</div>
            </td>
            <td colspan="7">
              <div>{{ this.form.ganshzl2 }}</div>
            </td>
          </tr>
          <tr>
            <td colspan="2" class="td-left" height="25">
              <div>损耗(g)</div>
            </td>
            <td colspan="4" class="td4">
              <div>{{ this.form.sunh1 }}</div>
            </td>
            <td colspan="7">
              <div>{{ this.form.sunh2 }}</div>
            </td>
          </tr>
          <tr>
            <td colspan="2" height="25">
              <div>损耗率(%)</div>
            </td>
            <td colspan="4">
              <div>{{ this.form.sunhl1 }}</div>
            </td>
            <td colspan="7">
              <div>{{ this.form.sunhl2 }}</div>
            </td>
          </tr>
          <tr>
            <td colspan="2" height="26">
              <div>扣除损耗后总量(g)</div>
            </td>
            <td colspan="4">
              <div>{{ this.form.koucshhzl1 }}</div>
            </td>
            <td colspan="7">
              <div>{{ this.form.koucshhzl2 }}</div>
            </td>
          </tr>
        </table>
        <!-- .....................................................33333333333333333................................................... -->
        <table height="60px" class="bottom-table">
          <tr>
            <td>
              <span v-if="isPdf" class="textarea-span">{{ form.fujsm }}</span>
              <el-input v-else type="textarea" :rows="2" v-model="form.fujsm" @focus="handleFocus('fujsm')" />
            </td>
          </tr>
        </table>
      </div>
      <!-- .................................44444444444............................................. -->
      <table height="22px" class="transparent">
        <tbody>
          <tr>
            <td width="10%" align="right">检测：</td>
            <td width="15%" align="left">
              <!-- {{this.form.jiancr}} -->
            </td>
            <td width="10%" align="right">记录：</td>
            <td width="15%" align="left">
              <!-- {{this.form.jilr}} -->
            </td>
            <td width="10%" align="right">复核：</td>
            <td align="left" width="15%">
              <!-- {{this.form.fuhr}} -->
            </td>
            <td width="10%">日期：</td>
            <td align="left" width="15%">
              <div style="display: inline-block; margin-right: 30px;">年</div>
              <div style="display: inline-block; margin-right: 30px;">月</div>
              <div style="display: inline-block;">日</div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
    <bs-instrument-view ref="bsInstrumentViewRef" @select="selectInstrument"></bs-instrument-view>
    <bs-jiancyj-view ref="bsJiancyjViewRef" @select="selectJiancyj" :syType="syType"></bs-jiancyj-view>
    <bs-judge-base-view ref="bsJudgeBaseViewRef" @select="selectJudge" :syType="syType"></bs-judge-base-view>
  </div>
</template>

<script>
import decimal from "@/utils/big-decimal";
import Bus from "@/utils/bus";
import { handleFocus, emptyConvert, uniqueStr, handleKeyDown } from "@/views/reportForms/utils";
import { listWjjhlCjlkljpsyBsInfo, getWjjhlCjlkljpsyBsInfo, delWjjhlCjlkljpsyBsInfo, addWjjhlCjlkljpsyBsInfo, updateWjjhlCjlkljpsyBsInfo } from "@/api/report_wjjhl/wjjhlCjlkljpsyBsInfo";
import BsInstrumentView from "@/views/dept/bsInstrument/BsInstrumentView";
import BsJiancyjView from "@/views/sycs/bsJiancyj/BsJiancyjView";
import BsJudgeBaseView from "@/views/sycs/bsJudgeBase/BsJudgeBaseView.vue";

export default {
  name: "cjlkljpsy",
  components: {
    BsInstrumentView,
    BsJiancyjView,
    BsJudgeBaseView
  },
  props: {
    excelId: {
      type: [String, Number],
      default: () => ""
    },
    syType: {
      type: [String, Number],
      default: () => ""
    },
    page: {
      type: Number,
      default: () => 0
    },
    isPdf: {
      type: Boolean,
      default: () => false
    },
    printEmpty: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      form: {
        baDetailVos: [{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}],
        baobbhList: []
      },
      backBgz: {}
    };
  },
  created() {
    this.getInfo();
  },
  watch: {
    isPdf(newVal, oldVal) {
      this.form = { ...emptyConvert(this.form, newVal) };
    }
  },
  methods: {
    // 根据报表id获取当前报表信息
    getInfo() {
      getWjjhlCjlkljpsyBsInfo(this.excelId || this.$defaultExcelId).then((response) => {
        this.form = response.data;
        this.setInitialValue();
      });
    },
    // 设置初始值
    setInitialValue() {
      if (this.form) {
        this.form.baobmc = this.form.baobmc || "粗集料颗粒级配试验检测记录表(水筛法)";
        this.form.baobbh = this.form.baobbh || "JGLQ02001b";
        this.$set(this.form, "baobbhList", []);
        this.form.baobbhList = ["JGLQ02013b"];
        if (!this.form.fujsm) {
          this.form.fujsm = "附加声明：";
        }
      }
    },
    // 显示仪器列表
    showBsInstrumentView() {
      this.$refs.bsInstrumentViewRef.init(this.form.shebIds);
    },
    // 仪器选择
    selectInstrument(info) {
      this.form.zhuyyqsbmcjbh = info.label;
      this.form.shebIds = info.ids;
      Bus.$emit("setCjlkljpBgZhuyyqsbmcjbh", { zhuyyqsbmcjbh: this.form.zhuyyqsbmcjbh, shebIds: this.form.shebIds });
    },
    // 显示检测依据列表
    showBsJiancyjView() {
      this.$refs.bsJiancyjViewRef.init(this.form.jiancyjIds);
    },
    // 检测依据选择
    selectJiancyj(info) {
      this.form.jiancyj = info.label;
      this.form.jiancyjIds = info.ids;
      Bus.$emit("setCjlkljpBgJiancyj", { jiancyj: this.form.jiancyj, jiancyjIds: this.form.jiancyjIds });
    },
    // 显示判定依据列表
    showBsJudgeBaseView() {
      this.$refs.bsJudgeBaseViewRef.init(this.form.pandyjIds);
    },
    // 判断依据选择
    selectJudge(info) {
       this.form.pandyjIds = info.ids;
      this.form.pandyj = info.label;
    },
    ganzsyzlChange(index) {
      this.detailChange(index);
      this.calculateShaixl(index);
      this.calculateTonggl(index);
    },
    shuixhsszlChange(index) {
      this.detailChange(index);
      this.calculateShaixl(index);
      this.calculateTonggl(index);
    },
    // 计算水洗0.075mm筛下量m0.075 (g)
    calculateShaixl(index) {
      // c= a-b
      const a = this.form["ganzsyzl" + index];
      const b = this.form["shuixhsszl" + index];
      let shaixl = null;
      if (a && b) {
        shaixl = decimal.subtract(a, b, 1);
      }
      this.form["shaixl" + index] = shaixl;
    },
    // 计算0.075mm通过率P0.075 (%)
    calculateTonggl(index) {
      // (a-b)/a*100
      const a = this.form["ganzsyzl" + index];
      const b = this.form["shuixhsszl" + index];
      let tonggl = null;
      if (a && b) {
        tonggl = decimal.multiply(decimal.divide(decimal.subtract(a, b), a, 10), 100, 1);
      }
      this.form["tonggl" + index] = tonggl;
      // 计算平均值
      let pingj = null;
      if (this.form.tonggl1 && this.form.tonggl2) {
        pingj = decimal.divide(decimal.add(this.form.tonggl1, this.form.tonggl2), 2, 1);
      }
      this.form.pingj = pingj;
    },
    shaikccChange() {
      this.detailChange(1);
      this.detailChange(2);
      this.backBgzFun();
    },
    detailChange(type) {
      this.computeShaifhzzl(type);
      this.computeKoucshhzl(type);
      this.computeSunhl(type);
      this.computeItem(type);
      this.backBgzFun();
    },
    // 计算各项数据
    computeItem(type) {
      const B = this.form["koucshhzl" + type];
      // 累计筛余
      let leijsy = 0;
      this.form.baDetailVos.forEach((item, index) => {
        if (!B || !item.shaikcc || !item["shaisz" + type] || (item.shaikcc.includes("底") && item["shaisz" + type] == 0)) {
          item["fenjsy" + type] = null;
          item["leijsy" + type] = null;
          item["tonggbfl" + type] = null;
          item.tonggbflPjz = null;
          return;
        }
        item["fenjsy" + type] = decimal.divide(decimal.multiply(item["shaisz" + type], 100), B, 1);
        item["leijsy" + type] = decimal.add(leijsy, item["fenjsy" + type], 1);
        item["tonggbfl" + type] = decimal.subtract(100, item["leijsy" + type], 1);
        leijsy = item["leijsy" + type];
        // 求平均值
        if (item.tonggbfl1 && item.tonggbfl2) {
          item.tonggbflPjz = decimal.divide(decimal.add(item.tonggbfl1, item.tonggbfl2), 2, 1);
        } else {
          item.tonggbflPjz = null;
        }
      });
    },
    // 计算筛分后总质量
    computeShaifhzzl(type) {
      const newVal = this.form.baDetailVos;
      let sum = 0;
      newVal.forEach((item) => {
        sum = decimal.add(sum, item["shaisz" + type] || 0, 1);
      });
      this.form["ganshzl" + type] = sum;
    },
    // 计算扣除损耗后试样总质量
    computeKoucshhzl(type) {
      if (!this.form["ganzsyzl" + type] || !this.form["shuixhsszl" + type] || !this.form["ganshzl" + type]) {
        this.form["koucshhzl" + type] = null;
        return;
      }
      // B=a-{b-(c+d+e+...+j)-k}
      this.form["koucshhzl" + type] = decimal.subtract(this.form["ganzsyzl" + type], decimal.subtract(this.form["shuixhsszl" + type], this.form["ganshzl" + type], 1), 1);
    },
    // 计算损耗率
    computeSunhl(type) {
      const a = this.form["ganzsyzl" + type];
      const b = this.form["koucshhzl" + type];
      if (!a || !b) {
        this.form["sunhl" + type] = "";
        this.form["sunh" + type] = "";
        return;
      }
      this.form["sunh" + type] = decimal.subtract(a, b);
      // 100*(a-b)/a
      this.form["sunhl" + type] = decimal.divide(decimal.multiply(decimal.subtract(a, b), 100), a);
    },
    // 给报告赋值
    backBgzFun() {
      const list = this.form.baDetailVos.map((item, index) => {
        let leijsy = null;
        if (item.leijsy1 && item.leijsy1) {
          leijsy = decimal.divide(decimal.add(item.leijsy1, item.leijsy1), 2, 1);
        }
        return { shaikcc: item.shaikcc, leijsy: leijsy, tonggbflPjz: item.tonggbflPjz, tonggbfl1: item.tonggbfl1, tonggbfl2: item.tonggbfl2, zuidz: item.zuidz || "-", zuixz: item.zuixz || "-" };
      });
      Bus.$emit("setCjlkljpBgShuiS", list);
      // 给配合比报告赋值
      Bus.$emit("setWdclphbsjBgShaikcc", list);
    },
    // 集料用途赋值
    backBgBaseData() {
      const info = {
        quydd: this.form.quydd,
        daibsl: this.form.daibsl,
        jincrq: this.form.jincrq,
        cd: this.form.cd,
        jilyt: this.form.jilyt,
        hunhlmc: this.form.hunhlmc,
        guidjpmc: this.form.guidjpmc
      };
      Bus.$emit("setCjlkljpBgBaseData", info);
    },
    submitForm() {
      return this.form;
    },
    handleFocus(event) {
      handleFocus(event, this.page, this.form[event]);
    },
    handleKeyDown(event, rowIndex, colIndex) {
      const maxArr = [1, 1, 2, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4];
      const ref = handleKeyDown(event, rowIndex, colIndex, maxArr);
      if (this.$refs[ref]?.length) {
        this.$refs[ref][0].focus();
      } else if (this.$refs[ref]) {
        this.$refs[ref].focus();
      }
    }
  }
};
</script>

<style scoped lang="scss">
.td-left {
  width: 15% !important;
}

.td1 {
  width: 100% / 13 * 1;
}

.td2 {
  width: 85% / 13 * 2;
}

.td3 {
  width: 85% / 13 * 3;
}

.td4 {
  width: 85% / 13 * 3;
}
</style>
